package com.portal.scheduling.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;

/**
 * 时间间隔的任务
 *
 * @author Amadeus
 * @date 2022/07/11
 */
@Slf4j
@Configuration
public class TimeIntervalTask {

    /**
     * 测试
     * 每两分钟执行一次
     */
    @Scheduled(cron = "0 0/2 * * * ?")
    public void test() {
        log.info("定时任务执行开始");
        log.info(new Date().toString());
    }

}
